import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-father',
  templateUrl: './father.component.html',
  styleUrls: ['./father.component.css']
})
export class FatherComponent implements OnInit {
  public username: string = 'ywj';
  // tslint:disable-next-line: no-inferrable-types
  public title: string = 'title';
  constructor() { }

  ngOnInit() {
  }
  run(){
    console.log('父组件的run方法')
  }
  // 使用ViewChild可以调用子组件的属性和方法


  runParent(msg: string) {
    // 得到数据
    console.log(msg);
  }
}
